package com.baomidou.config;

import com.baomidou.config.rules.IdStrategy;
import com.baomidou.config.rules.NamingStrategy;
import org.apache.maven.plugins.annotations.Parameter;

/**
 * 策略配置项
 *
 * @author YangHu, tangguo, hubin
 * @since 2016/8/30
 */
public class StrategyConfig {

    /**
     * 数据库表映射到实体的命名策略
     */
    @Parameter(defaultValue = "nochange")
    private NamingStrategy naming;

    @Parameter(defaultValue = "underline_to_camel")
    private NamingStrategy fieldNaming;

    /**
     * 表前缀
     */
    @Parameter
    private String tablePrefix;

    /**
     * Entity 中的ID生成类型
     */
    @Parameter(defaultValue = "ID_WORKER")
    private IdStrategy idGenType;

    /**
     * 自定义继承的Entity类全称，带包名
     */
    @Parameter
    private String superEntityClass;

    /**
     * 自定义继承的Mapper类全称，带包名
     */
    @Parameter(defaultValue = ConstVal.SUPERD_MAPPER_CLASS)
    private String superMapperClass;

    /**
     * 自定义继承的Service类全称，带包名
     */
    @Parameter(defaultValue = ConstVal.SUPERD_SERVICE_CLASS)
    private String superServiceClass;

    /**
     * 自定义继承的ServiceImpl类全称，带包名
     */
    @Parameter(defaultValue = ConstVal.SUPERD_SERVICEIMPL_CLASS)
    private String superServiceImplClass;

    /**
     * 自定义继承的Controller类全称，带包名
     */
    @Parameter
    private String superControllerClass;

    /*
     * 需要包含的表名（与exclude二选一配置）
     */
    @Parameter
    private String[] include = null;

    /**
     * 需要排除的表名
     */
    @Parameter
    private String[] exclude = null;

    private String modelSuffix;

    @Parameter(defaultValue = "false")
    private String ultraManOpen;

    @Parameter(defaultValue = "https://ultraman.xforcecloud.com/api")
    private String ultraManUrl;

    @Parameter(defaultValue = "/global/bocp/bos/%s/fields-extends")
    private String ultraManPath;

    private String ultraManSchemaPath;

    @Parameter(defaultValue = "accountVoucher=1346014739375783937;")
    private String ultraManRelation;

    private String ultraManUsername;

    private String ultraManPassword;

    private String ultraManChangeTenantId;

    public String getModelSuffix() {
        return modelSuffix;
    }

    public void setModelSuffix(String modelSuffix) {
        this.modelSuffix = modelSuffix;
    }

    public String getUltraManPath() {
        return ultraManPath;
    }

    public void setUltraManPath(String ultraManPath) {
        this.ultraManPath = ultraManPath;
    }

    public String getUltraManSchemaPath() {
        return ultraManSchemaPath;
    }

    public void setUltraManSchemaPath(String ultraManSchemaPath) {
        this.ultraManSchemaPath = ultraManSchemaPath;
    }

    public String getUltraManChangeTenantId() {
        return ultraManChangeTenantId;
    }

    public void setUltraManChangeTenantId(String ultraManChangeTenantId) {
        this.ultraManChangeTenantId = ultraManChangeTenantId;
    }

    public String getUltraManUsername() {
        return ultraManUsername;
    }

    public void setUltraManUsername(String ultraManUsername) {
        this.ultraManUsername = ultraManUsername;
    }

    public String getUltraManPassword() {
        return ultraManPassword;
    }

    public void setUltraManPassword(String ultraManPassword) {
        this.ultraManPassword = ultraManPassword;
    }

    public String getUltraManOpen() {
        return ultraManOpen;
    }

    public void setUltraManOpen(String ultraManOpen) {
        this.ultraManOpen = ultraManOpen;
    }

    public String getUltraManUrl() {
        return ultraManUrl;
    }

    public void setUltraManUrl(String ultraManUrl) {
        this.ultraManUrl = ultraManUrl;
    }

    public String getUltraManRelation() {
        return ultraManRelation;
    }

    public void setUltraManRelation(String ultraManRelation) {
        this.ultraManRelation = ultraManRelation;
    }

    public NamingStrategy getNaming() {
        return naming;
    }

    public NamingStrategy getFieldNaming() {
        if (fieldNaming == null) {
            return naming;
        }
        return fieldNaming;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    public IdStrategy getIdGenType() {
        return idGenType;
    }

    public String[] getInclude() {
        return include;
    }

    public String[] getExclude() {
        return exclude;
    }

    public String getSuperServiceClass() {
        return superServiceClass;
    }

    public String getSuperEntityClass() {
        return superEntityClass;
    }

    public void setSuperEntityClass(String superEntityClass) {
        this.superEntityClass = superEntityClass;
    }

    public String getSuperMapperClass() {
        return superMapperClass;
    }

    public String getSuperServiceImplClass() {
        return superServiceImplClass;
    }

    public String getSuperControllerClass() {
        return superControllerClass;
    }

}
